/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.yunhoo.sys.db.util;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import java.io.Reader;

/**
 *
 * @author Administrator
 */
public class DbTool {

    public static SqlMapClient getSqlMapClient() {
        String resource = "com/yunhoo/sys/db/config/sqlMapConfig.xml";
        SqlMapClient sqlMap = null;
        try {
            Reader reader = Resources.getResourceAsReader(resource);
            sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return sqlMap;
    }
}
